package com.longge;

public class ArrangeCoins {
    public int arrangeCoins(int n) {
        int count = 0, col = 0;
        while (n > 0) {
            col++;
            n -= col;
            count++;
        }
        return n == 0 ? count : --count;

    }
}
